package com.boronstream.istar.model;

import java.util.Iterator;

import org.json.JSONException;
import org.json.JSONObject;

public class Symbol extends PlayObject {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String star_name;
	private String quardian;
	private String property;
	private String symbol;
	private String represent;
	private String lover;
	private String characters;
	private String boron_time;

	public Symbol(JSONObject jsonObject) {
		try {
			Iterator<String> keys = jsonObject.keys();
			while (keys.hasNext()) {
				String key = keys.next();
				this.initParamWithJsonAndKey(jsonObject, key);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public String getStar_name() {
		return star_name;
	}

	public void setStar_name(String star_name) {
		this.star_name = star_name;
	}

	public String getQuardian() {
		return quardian;
	}

	public void setQuardian(String quardian) {
		this.quardian = quardian;
	}

	public String getProperty() {
		return property;
	}

	public void setProperty(String property) {
		this.property = property;
	}

	public String getSymbol() {
		return symbol;
	}

	public void setSymbol(String symbol) {
		this.symbol = symbol;
	}

	public String getRepresent() {
		return represent;
	}

	public void setRepresent(String represent) {
		this.represent = represent;
	}

	public String getLover() {
		return lover;
	}

	public void setLover(String lover) {
		this.lover = lover;
	}

	public String getCharacters() {
		return characters;
	}

	public void setCharacters(String characters) {
		this.characters = characters;
	}

	public String getBoron_time() {
		return boron_time;
	}

	public void setBoron_time(String boron_time) {
		this.boron_time = boron_time;
	}

	@Override
	public String toString() {
		return "Symbol [star_name=" + star_name + ", quardian=" + quardian
				+ ", property=" + property + ", symbol=" + symbol
				+ ", represent=" + represent + ", lover=" + lover
				+ ", characters=" + characters + ", boron_time=" + boron_time
				+ "]";
	}

	@Override
	public void initParamWithJsonAndKey(JSONObject jsonObject, String key)
			throws JSONException {
		if ("star_name".equals(key)) {
			this.setStar_name(jsonObject.getString(key));
		}
		if ("guardian".equals(key)) {
			this.setQuardian(jsonObject.getString(key));
		}
		if ("property".equals(key)) {
			this.setProperty(jsonObject.getString(key));
		}
		if ("symbol".equals(key)) {
			this.setSymbol(jsonObject.getString(key));
		}
		if ("represent".equals(key)) {
			this.setRepresent(jsonObject.getString(key));
		}
		if ("lover".equals(key)) {
			this.setLover(jsonObject.getString(key));
		}
		if ("characters".equals(key)) {
			this.setCharacters(jsonObject.getString(key));
		}
		if ("boron_time".equals(key)) {
			this.setBoron_time(jsonObject.getString(key));
		}
	}

}
